import { gql } from "@apollo/client";
export const GET_PRODUCTS = gql`
  query getProducts($page: PageInput!) {
    getProducts(page: $page) {
      code
      message
      data {
        id
        name
        desc
        stock
        curStock
        buyNumber
        limitBuyNumber
        coverUrl
        bannerUrl
        orginalPrice
        preferentialPrice
        org {
          id
        }
      }
      page {
        pageNum
        pageSize
        total
      }
    }
  }
`;
export const GET_PRODUCT = gql`
  query getProductInfo($id: String!) {
    getProductInfo(id: $id) {
      code
      message
      data {
        id
        name
        desc
        stock
        curStock
        buyNumber
        limitBuyNumber
        coverUrl
        bannerUrl
        orginalPrice
        preferentialPrice
        org {
          id
        }
        cards {
          id
          name
          type
          time
          validityDay
          course {
            name
          }
        }
      }
    }
  }
`;
export const COMMIT_PRODUCT = gql`
  mutation commitProduct($params: PartialProductInput!, $id: String) {
    commitProduct(params: $params, id: $id) {
      code
      message
    }
  }
`;
export const DELETE_PRODUCT = gql`
  mutation deleteProduct($id: String!) {
    deleteProduct(id: $id) {
      code
      message
    }
  }
`;
